<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>btn1</button>
    <button>btn2</button>
    <button>btn3</button>
    <script>
        // for of  
        /* 
        能遍历数组
        能遍历set
        能遍历map
        能遍历字符串
        遍历伪数组      
        因为在他们的原型对象上都有iterator接口
        不能遍历对象，因为对象上没有iterator
        */
       let arr = [1,5,8];
       for(let num of arr){
           console.log(num);
       }

       let set = new Set([5,5,8,9]);
       console.log(set);
       for(let item of set){
           console.log(item);
       }

       let map = new Map([['name','yanzhen'],['age',10]]);
       console.log(map);
       for(let itemmap of map){
           console.log(itemmap);
       }

       let str = 'wfegrty';
       for(let item of str){
           console.log(item);
       }

       let btnarr = document.querySelectorAll('button');
       console.log(btnarr);

       let obj = {
           name:'tom',
           age:10
       }
       /* for(let item of obj){
           console.log(item);
       } */
       console.log(obj);
       
    //    
    </script>
</body>
</html>